﻿@using RhotCMS.Helpers;

<div id="menu">
    <ul>
        @{
            var items = Html.GetTopMenuList(Html.GetUILangName()).ToList();
            
            var lastItem = items[items.Count() - 1].Name;
        }

        @foreach (var item in items)
        {
            <li @(item.ControllerName.Equals(ViewBag.Group, StringComparison.InvariantCultureIgnoreCase) && item.ActionName.Equals(ViewBag.Name, StringComparison.InvariantCultureIgnoreCase) ? "class=menu_item_selected" : String.Empty)>@Html.RouteLinkPages(item.Name, item.ControllerName, item.ActionName)</li>
            
            if (!lastItem.Equals(item.Name))
            {
                <li><span>|</span></li>
            }
        }
    </ul>
</div>
